{set:
	$site_config=new Config('site_config');
	$seo_data=array();
	$seo_data['title']=$site_config->name;
	$seo_data['title'].=$site_config->index_seo_title;
	$seo_data['keywords']=$site_config->index_seo_keywords;
	$seo_data['description']=$site_config->index_seo_description;
	seo::set($seo_data);
}


<script type="text/javascript" src="{theme:javascript/jquery.flexslider-min.js}"></script>
<div class="w">
	<!--o-slide-->
	<div id="o-slide">
		<!--幻灯片 开始-->

		 <div class="flexslider" >
		    {if:$this->index_slide}
		    <ul class="slides">
		        {foreach:items=$this->index_slide}
		        <li> <a href="{url:$item[url]}" target="_blank"> <img src="{webroot:$item[img]}" alt=""></a></li>
		        {/foreach}
		    </ul>
		    {/if}
		</div>
		
		<div class="jscroll">
			{echo:Ad::show("首页幻灯片_下方1(220*159)")}
			{echo:Ad::show("首页幻灯片_下方2(220*159)")}
			{echo:Ad::show("首页幻灯片_下方3(220*159)")}
		</div>
	</div>
	<!--o-slide-->
	
	<div class="m fr da0x70">
		{echo:Ad::show("首页幻灯片_右1(310*70)")}
	</div>
	<div id="jdnews" class="m m1">
		<div class="mt">
		<h2>网站公告</h2>
		<div class="extra"><a href="{url:/site/notice}" target="_blank">更多公告&nbsp;&gt;</a></div>
		</div>
		<div class="mc">
		<ul>
		{foreach:items=Api::run('getAnnouncementList',10)}
		{set:$tmpId=$item['id'];}
		<li  class="{if:$key%2 ==0}odd{/if}"><a href="{url:/site/notice_detail/id/$tmpId}">{$item['title']}</a></li>
		{/foreach}

	
		</ul>
		</div>
	</div>
	
	<div class="m fr da0x70" style="margin-top:10px;height:145px;">
		{echo:Ad::show("首页幻灯片_右2(310*145)")}
	</div>

	
</div>
{foreach:items=Api::run('getCategoryListTop')  item=$first }
<div class="clear"></div>
<!--floors-list-->
<div id="floors-list" class="mt20">
	<div class="w w1">
		<!--catalogue-->
		<div class="catalogue m m1 ">
			<div class="mt ld">
			<div class="floor">
			<b class="fixpng b b1"></b><b class="fixpng b b2" style="height: 34px; display: block;"></b>
			<b class="b b3">{echo:$key+1}F</b><b class="fixpng b4"></b></div>
			<h2 style="font-size:22px;">{$first['name']}</h2>
			</div>
			<div class="mc">
			<div class="style1">
			<ul class="lh">
			
			{foreach:items=Api::run('getCategoryByParentid',array('#parent_id#',$first['id']))  item=$second}
			<li><a href="{url:/site/pro_list/cat/$second[id]}">{$second['name']}</a></li>
			{/foreach}
			</ul>
			<span>
			{echo:Ad::show("首页商品分类_左1(209*155)",$first['id'])}
			</span>
			</div>
			</div>
		</div>
		<!--catalogue-->
		<!--m plist-->
		<Div class="m plist">
			<div class="hl_p_menu">
				{foreach:items=Api::run('getCategoryByParentid',array('#parent_id#',$first['id']),5)  item=$second}
				<a href="javascript:void(0);" {if:$key==0} class="cur" {/if}>{$second['name']}
					<div class="tab-arrow" style="left: 0px;"><b></b></div>
				</a>
				{/foreach}
				
			</div>
			<div class="clear"></div>
			<div class="hlsmc">
				
				{foreach:items=Api::run('getCategoryByParentid',array('#parent_id#',$first['id']),5)  item=$second}
				<ul class="lh style3" style="{if:$key>0}display:none;{/if}">
					{foreach:items=Api::run('getCategoryExtendList',array('#categroy_id#',$second['id']),10)}
					<li class="fore{echo:$key+1;}">            
						<div class="p-img ld"><a target="_blank" href="{url:/site/products/id/$item[id]}" title="{$item['name']}">
						<img height="100" width="100" alt="{$item['name']}" src="{url:/pic/thumb/img/$item[img]/w/100/h/100}"></a></div>            
						<div class="p-name">
							<a target="_blank" href="{url:/site/products/id/$item[id]}" title="{$item['name']}">{$item['name']}</a>
						</div>            
						<div class="p-price"><span>￥</span>{$item['sell_price']}</div>        
						</li>
					{/foreach}
				</ul>
				{/foreach}
			</div>
			
		</Div>
		<!--m plist-->
		
		<div class="sm sm1 pbrands">
			<div class="smt">
			<div class="extra">
			<a href="{url:/site/pro_list/cat/$first[id]}" target="_blank">更多>></a>
			</div>
			</div>
			
			<div class="smc">
			<ul class="lh">
				{set:$brand_list = Api::run('getBrandListByGoodsCategoryId',$first['id']);}
	            {if:$brand_list}
		           {foreach:items = $brand_list}
					 <li><a href="{url:/site/brand_zone/id/$tmpId}"><img height="35" width="98"  src="{webroot:$item[logo]}" /></a></li>
					{/foreach}
				 {/if}
			</ul>
			</div>

			<div class="fr da209x180">
				{echo:Ad::show("首页商品分类_右1(209*180)",$first['id'])}
			</div>
		</div>
	
	</div>
</div>
<!--floors-list-->
<div class="clear"></div>
{/foreach}


<script type='text/javascript'>
//dom载入完毕执行
jQuery(function()
{
	//幻灯片开启

	$('.flexslider').flexslider(
	{
		animation: "slide",
		directionNav: false,
		animationLoop: false,
		controlNav: true,
		slideToStart: 0,
		slideshow: true,
		animationDuration: 300
	});

	$(".hl_p_menu a").hover(function(){
	$(this).addClass('cur').siblings().removeClass('cur');
	var p= $(this).index();
	$(this).parent().parent().children(".hlsmc").children("ul").eq(p).show().siblings().hide();

	});  


	  


	//email订阅 事件绑定

	//显示抢购倒计时
	var cd_timer = new countdown();
	{if:isset($countNumsItem) && $countNumsItem}
	{foreach:items = $countNumsItem}
		cd_timer.add({$item});
	{/foreach}
	{/if}

	//首页商品变色
	var colorArray = ['green','yellow','purple'];
	$('div[name="showGoods"]').each(function(i)
	{
		$(this).addClass(colorArray[i%colorArray.length]);
	});
});

//电子邮件订阅
function orderinfo()
{
	var email = $('[name="orderinfo"]').val();
	if(email == '')
	{
		alert('请填写正确的email地址');
	}
	else
	{
		$.getJSON('{url:/site/email_registry}',{email:email},function(content){
			if(content.isError == false)
			{
				alert('订阅成功');
				$('[name="orderinfo"]').val('');
			}
			else
				alert(content.message);
		});
	}
}


</script>